import qs from 'querystring'
import request from './request'

const LIST_PATH = 'categories'
const DEL_PATH = 'categories/'
const ADD_PATH = 'categories'
function cateList(params) {
    return request({
        url: LIST_PATH + '?' + qs.stringify(params),
        method: 'get'
    })
}

function delList(id){
    return request({
        url:DEL_PATH + id,
        method:'delete'
    })
}

function addList(obj){
    return request({
        url:ADD_PATH,
        method:'post',
        data:obj
    })
}
export {cateList,delList,addList}